package org.lee.service;

import org.lee.bean.Order;
import org.lee.mapper.OrderMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author lizhe
 */
@Service
public class OrderService {

    @Autowired
    private OrderMapper mapper;

    public int add(Order record) {
        return mapper.insert(record);
    }

    public int delete(Long orderId, Integer userId) {
        return mapper.deleteByPrimaryKey(orderId, userId);
    }

    public int update(Order order) {
        return mapper.updateByPrimaryKey(order);
    }

    public Order findOne(Long orderId, Integer userId) {
        return mapper.selectByPrimaryKey(orderId, userId);
    }
}
